<template>
  <div id="app">
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>

<script>
export default {
  name: "app",
  data() {
    return {
      timer: null,
    };
  },
  watch: {
    "$route.fullPath"(newV) {
      window.clearInterval(this.timer);
      this.timer = setInterval(() => {
        this.$bus.$emit("refresh");
      }, 1000 * 60 * 3);
    },
  },
  mounted() {
    this.timer = setInterval(() => {
      this.$bus.$emit("refresh");
    }, 1000 * 60 * 3);
  },
};
</script>

<style lang="scss">
html,
body {
  width: 100%;
  height: 100%;
}
#app {
  width: 100%;
  height: 100%;
  font-family: Microsoft YaHei;
  color: #ffffff;
}
</style>
